<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>欢迎使用山洪预报预警系统</title>
<script type="text/javascript" src="<s:property value="#application.cxt"/>/js/jquery/jquery.min.js?ver=1.7.1"></script>
<style type="text/css">
*{overflow:hidden; font-size:9pt;}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-repeat: repeat-x;
	background-color: #FFFFFF;
}
</style>

<script language="JavaScript" type="text/JavaScript">

$(document).keypress(function(event) {
	if (event.which == 13)
		$("#loginform").submit();
});

//--------------------------------------
//当验证码输入域得到焦点时获取并显示验证码
//function showVerifyCode()
//{
//	var codeimg = document.getElementById("verifycodeimg");
//	//alert(codeimg.src.indexOf(".action"));
//	if (codeimg.src.indexOf(".action") == -1)
//	{
//		codeimg.src="${cxtpath}/security/login_verifyCode.action?random=" + Math.random();
//	}
//}
//切换验证码
function reloadVerifyCode()
{
	var codeimg = document.getElementById("verifycodeimg");
	codeimg.src="${cxtpath}/system/system_verifyCode.action?random=" + Math.random();
	//alert(codeimg.src);
}

function submitform() {
	document.getElementById("loginform").submit();
}
//验证表单数据
function doVerify(form){
	if (form.username.value == "")
	{
		alert("请输入您的用户名！");
		form.username.focus();
		return false;
	}
	if (form.password.value == "")
	{
		alert("请输入用户密码！");
		form.password.focus();
		return false;
	}
	if (form.verifycode.value == "")
	{
		alert("请输入验证码！");
		form.verifycode.focus();
		return false;
	}
	return true;
}

</script>
</head>

<body>
<table width="100%"  height="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="561" style="background:url(${cxt}/images/lbg.gif)"><table width="940" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td height="238" style="background:url(${cxt}/images/login01.jpg)">&nbsp;</td>
          </tr>
          <tr>
            <td height="190">         
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="208" height="190" style="background:url(images/login02.jpg)">&nbsp;</td>
                <td width="518" style="background:url(${cxt}/images/login03.jpg)">
                <form id="loginform" action="${cxt}/security/login_userLogin.action" method="post" onsubmit="javascript:return doVerify(this)" >
                <table width="320" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="40" height="36">&nbsp;</td>
                    <td width="60" height="36">用户名：</td>
                    <td height="36" colspan="2"><input type="text" name="username" value="kingpower" style="width:164px; height:24px; repeat-x; border:solid 1px #d1d1d1; font-size:14pt;"></td>
                  </tr>
                  <tr>
                    <td height="36">&nbsp;</td>
                    <td height="36">密　码：</td>
                    <td height="36" colspan="2"><input type="password" name="password" value="admin" style="width:164px; height:24px; border:solid 1px #d1d1d1; font-size:12pt; "></td>
                  </tr>
                  <tr>
                    <td height="36">&nbsp;</td>
                    <td height="36">验证码：</td>
                    <td width="98" height="36"><input name="verifycode" style="width:70px; height:20px; border:solid 1px #d1d1d1; font-size:10pt; " onfocus="reloadVerifyCode()"></td>
                  	<td width="122" height="36"><img id="verifycodeimg" src="${cxt}/images/button.gif" title="点击，换一张" width="70" height="22" onclick="reloadVerifyCode()" style="cursor:pointer" ></td>
                  </tr>
                  <tr>
                    <td height="59" colspan="4" align="center"><img id="loginbut" src="${cxt}/images/login.gif" onclick="submitform()" width="95" height="34" border="0" style="cursor:pointer;"></td>
                  </tr>
                </table>
                </form>
                </td>
                <td width="214" style="background:url(${cxt}/images/login04.jpg)" >&nbsp;<s:actionmessage/>&nbsp;</td>
              </tr>
            </table>
            </td>
          </tr>
          <tr>
            <td height="133" style="background:url(${cxt}/images/login05.jpg)">&nbsp;</td>
          </tr>
        </table>
        </td>
      </tr>
    </table>
    </td>
  </tr>
</table>
</body>
</html>